//
//  XBNewViewController.m
//  FindPreciousFrameWork
//
//  Created by TianZhen on 16/4/11.
//  Copyright © 2016年 MoreMoney. All rights reserved.
//
#import "XBNewModel.h"
#import "XBNewViewController.h"
#import "JingxuanTableView.h"
#import "XBNewCell.h"

@interface XBNewViewController ()
@end

@implementation XBNewViewController

- (void)loadView
{
    [super loadView];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
}

#pragma mark - ======== 数据源 ========

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // 获取当前模型
    XBNewModel *model = self.JingxuanModels[indexPath.row];
    
    // 拿到cell
    XBNewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"XBNewCell" forIndexPath:indexPath];
    
    // 赋值
    cell.model = model;
    
    return cell;
}

#pragma mark - ======== 代理 ========

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    XBNewCell *cell = [[NSBundle mainBundle] loadNibNamed:@"XBNewCell" owner:nil options:nil].lastObject;
    
    return cell.frame.size.height;
}


- (NSArray *)JingxuanModels
{
    return [XBNewModel models];
}

@end
